package com.phz.springcloud.study;


import org.springframework.amqp.core.Queue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

import com.phz.springcloud.study.service.UserService;

@SpringBootApplication
@EnableEurekaClient
public class StudyUserServiceApplication {

	public static void main(String[] args) {
		SpringApplication.run(StudyUserServiceApplication.class, args);
	}
	
	@Bean
	public PasswordEncoder bCryptPasswordEncoder() {
		return new BCryptPasswordEncoder();
	}
	
	@Bean
    public Queue registerQueue() {
        return new Queue(UserService.REGESITER_ROUTINGKEY,false);
    }
	
	@Bean
    public Queue registerGetScoreQueue() {
        return new Queue(UserService.REGESITER_SCORE_ROUTINGKEY,false);
    }
	
	@Bean
    public Queue scoreQueue() {
        return new Queue(UserService.SCORE_ROUTINGKEY,true);
    }
	
	
}
